import request from '@/utils/request'
import requestNew from '@/utils/requestNew'

// 查询【请填写功能名称】列表
export function listBudgetFunds(query) {
  return request({
    url: '/budget/budget/list',
    method: 'get',
    params: query
  })
}

// 操作日志
export function operationLog(query) {
  return request({
    url: '/budget/operationLog/list',
    method: 'get',
    params: query
  })
}

// 资金预算审批列表
export function approvalList(query) {
  return request({
    url: '/budget/approval/list',
    method: 'get',
    params: query
  })
}

// 提交
export function countySubmit(data) {
  return request({
    url: '/budget/budget/countySubmit',
    method: 'post',
    data: data
  })
}


//第三步 汇总
export function statisForAddOrUpdate(regionCodes, year, budgetId, pageNum, pageSize) {
  return request({
    url: '/budget/budget/statisForAddOrUpdate?regionCodes=' + regionCodes + "&year=" + year + "&pageNum=" + pageNum + "&pageSize=" + pageSize + "&budgetId=" + budgetId,
    method: 'get',
  })
}

// 预算明细-修改汇总
export function childList(parentBudgetId, pageNum, pageSize) {
  return request({
    url: '/budget/budget/childList/' + parentBudgetId + "?pageNum=" + pageNum + "&pageSize=" + pageSize,
    method: 'get',
  })
}

export function childListByMutiParentIds(parentBudgetIds) {
  return request({
    url: '/budget/budget/childListByMutiParentIds/' + parentBudgetIds,
    method: 'get',
  })
}

// 多条预算-汇总
export function statis(budgetIds) {
  return request({
    url: '/budget/budget/statis/' + budgetIds,
    method: 'get',
  })
}

//多条预算-明细
export function mxListByBudgetIds(query) {
  return request({
    url: '/budget/budget/mxListByBudgetIds',
    method: 'get',
    params: query
  })
}

// 生成发放临时数据
export function generate(data) {
  return requestNew({
    url: '/distribution/payment/generate',
    method: 'post',
    data: data
  })
}

export function verifyForAddOrUpdateTownship(data) {
  return requestNew({
    url: '/budget/budget/verifyForAddOrUpdateTownship',
    method: 'post',
    data: data
  })
}

// 资金预算生成汇总金额
export function countyMoney(data) {
  return request({
    url: '/budget/item/countyMoney',
    method: 'POST',
    data: data
  })
}

// 预算明细
export function mxList(query) {
  return request({
    url: 'budget/budget/mxList',
    method: 'get',
    params: query
  })
}

//多条预算明细导出
export function exportMxList(query) {
  return request({
    url: '/budget/budget/exportMxList/',
    method: 'get',
    params: query
  })
}

export function exportList(query) {
  return request({
    url: '/budget/budget/export/',
    method: 'get',
    params: query
  })
}

// 预算明细
export function VillageMxList(query) {
  return request({
    url: '/budget/budget/VillageMxList',
    method: 'get',
    params: query
  })
}

// 我的预算
export function listMyBudgetFunds(query) {
  return request({
    url: 'budget/budget/mYSubmitList',
    method: 'get',
    params: query
  })
}

// 获取编码
export function getNumber() {
  return request({
    url: '/budget/budget/getNumber',
    method: 'get',
  })
}

// 获取单位
export function deptList() {
  return request({
    url: '/budget/budget/deptList',
    method: 'get',
  })
}


// 生成预算
export function countyAdd(data) {
  return request({
    url: '/budget/budget/countyAdd',
    method: 'post',
    data: data
  })
}

// 获取预算明细-审批
export function subApprovalList(data, pageNum, pageSize) {
  return request({
    url: '/budget/item/subApprovalList?pageNum=' + pageNum + "&pageSize=" + pageSize,
    method: 'post',
    data: data
  })
}

// 审批
export function approval(data) {
  return request({
    url: '/budget/approval/add',
    method: 'post',
    data: data
  })
}

// 获取预算明细
export function approvalMoney(data) {
  return request({
    url: '/budget/item/approvalMoney/',
    method: 'post',
    data: data
  })
}

export function subList(data, pageNum, pageSize) {
  return request({
    url: '/budget/item/subList?pageNum=' + pageNum + "&pageSize=" + pageSize,
    method: 'post',
    data: data
  })
}

// 查询【请填写功能名称】详细
export function getBudgetFunds(id) {
  return request({
    url: '/budget/budget/' + id,
    method: 'get'
  })
}

// 新增【请填写功能名称】
export function addBudgetFunds(data) {
  return request({
    url: '/budget/budget/add',
    method: 'post',
    data: data
  })
}

// 修改【请填写功能名称】
export function updateBudgetFunds(data) {
  return request({
    url: 'budget/budget',
    method: 'put',
    data: data
  })
}

// 删除【请填写功能名称】
export function delBudgetFunds(id) {
  return request({
    url: '/budget/budget/' + id,
    method: 'delete'
  })
}

// 导出【请填写功能名称】
export function exportBudgetFunds(query) {
  return request({
    url: '/system/BudgetFunds/export',
    method: 'get',
    params: query
  })
}
